home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / Macintosh Programmer’s Workshop / MPW 3.1 / MPW / Interfaces / CIncludes / Windows.h < prev   
Text File  |  1990-12-13  |  8KB  |  291 lines

  1. /************************************************************
  2.  
  3. Created: Saturday, September 16, 1989 at 4:45 PM
  4.     Windows.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.     Copyright Apple Computer, Inc.    1985-1989
  9.     All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __WINDOWS__
  15. #define __WINDOWS__
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <Quickdraw.h>
  19. #endif
  20.  
  21. #ifndef __EVENTS__
  22. #include <Events.h>
  23. #endif
  24.  
  25. #ifndef __CONTROLS__
  26. #include <Controls.h>
  27. #endif
  28.  
  29. #define documentProc 0
  30. #define dBoxProc 1
  31. #define plainDBox 2
  32. #define altDBoxProc 3
  33. #define noGrowDocProc 4
  34. #define zoomDocProc 8
  35. #define zoomNoGrow 12
  36. #define rDocProc 16
  37. #define dialogKind 2
  38. #define userKind 8
  39.  
  40. /* FindWindow Result Codes */
  41.  
  42. #define inDesk 0
  43. #define inMenuBar 1
  44. #define inSysWindow 2
  45. #define inContent 3
  46. #define inDrag 4
  47. #define inGrow 5
  48. #define inGoAway 6
  49. #define inZoomIn 7
  50. #define inZoomOut 8
  51.  
  52. /* window messages */
  53.  
  54. #define wDraw 0
  55. #define wHit 1
  56. #define wCalcRgns 2
  57. #define wNew 3
  58. #define wDispose 4
  59. #define wGrow 5
  60. #define wDrawGIcon 6
  61.  
  62. /* defProc hit test codes */
  63.  
  64. #define wNoHit 0
  65. #define wInContent 1
  66. #define wInDrag 2
  67. #define wInGrow 3
  68. #define wInGoAway 4
  69. #define wInZoomIn 5
  70. #define wInZoomOut 6
  71. #define deskPatID 16
  72.  
  73. /* Window Part Identifiers which correlate color table entries with window elements */
  74.  
  75. #define wContentColor 0
  76. #define wFrameColor 1
  77. #define wTextColor 2
  78. #define wHiliteColor 3
  79. #define wTitleBarColor 4
  80.  
  81. typedef pascal void (*DragGrayRgnProcPtr)(void);
  82.  
  83. struct WindowRecord {
  84.     GrafPort port;
  85.     short windowKind;
  86.     Boolean visible;
  87.     Boolean hilited;
  88.     Boolean goAwayFlag;
  89.     Boolean spareFlag;
  90.     RgnHandle strucRgn;
  91.     RgnHandle contRgn;
  92.     RgnHandle updateRgn;
  93.     Handle windowDefProc;
  94.     Handle dataHandle;
  95.     StringHandle titleHandle;
  96.     short titleWidth;
  97.     ControlHandle controlList;
  98.     struct WindowRecord *nextWindow;
  99.     PicHandle windowPic;
  100.     long refCon;
  101. };
  102.  
  103. typedef struct WindowRecord WindowRecord;
  104. typedef WindowRecord *WindowPeek;
  105.  
  106. struct CWindowRecord {
  107.     CGrafPort port;
  108.     short windowKind;
  109.     Boolean visible;
  110.     Boolean hilited;
  111.     Boolean goAwayFlag;
  112.     Boolean spareFlag;
  113.     RgnHandle strucRgn;
  114.     RgnHandle contRgn;
  115.     RgnHandle updateRgn;
  116.     Handle windowDefProc;
  117.     Handle dataHandle;
  118.     StringHandle titleHandle;
  119.     short titleWidth;
  120.     ControlHandle controlList;
  121.     struct CWindowRecord *nextWindow;
  122.     PicHandle windowPic;
  123.     long refCon;
  124. };
  125.  
  126. typedef struct CWindowRecord CWindowRecord;
  127. typedef CWindowRecord *CWindowPeek;
  128.  
  129. struct WStateData {
  130.     Rect userState;             /*user state*/
  131.     Rect stdState;                /*standard state*/
  132. };
  133.  
  134. typedef struct WStateData WStateData;
  135. typedef WStateData *WStateDataPtr, **WStateDataHandle;
  136.  
  137. struct AuxWinRec {
  138.     struct AuxWinRec **awNext;    /*handle to next AuxWinRec*/
  139.     WindowPtr awOwner;            /*ptr to window */
  140.     CTabHandle awCTable;        /*color table for this window*/
  141.     Handle dialogCItem;         /*handle to dialog manager structures*/
  142.     long awFlags;                /*reserved for expansion*/
  143.     CTabHandle awReserved;        /*reserved for expansion*/
  144.     long awRefCon;                /*user Constant*/
  145. };
  146.  
  147. typedef struct AuxWinRec AuxWinRec;
  148. typedef AuxWinRec *AuxWinPtr, **AuxWinHandle;
  149.  
  150. struct WinCTab {
  151.     long wCSeed;                /*reserved*/
  152.     short wCReserved;            /*reserved*/
  153.     short ctSize;                /*usually 4 for windows*/
  154.     ColorSpec ctTable[5];
  155. };
  156.  
  157. typedef struct WinCTab WinCTab;
  158. typedef WinCTab *WCTabPtr, **WCTabHandle;
  159.  
  160. #ifdef __cplusplus
  161. extern "C" {
  162. #endif
  163. pascal void InitWindows(void)
  164.     = 0xA912;
  165. pascal void GetWMgrPort(GrafPtr *wPort)
  166.     = 0xA910;
  167. pascal WindowPtr NewWindow(Ptr wStorage,const Rect *boundsRect,const Str255 title,
  168.     Boolean visible,short theProc,WindowPtr behind,Boolean goAwayFlag,long refCon)
  169.     = 0xA913;
  170. pascal WindowPtr GetNewWindow(short windowID,Ptr wStorage,WindowPtr behind)
  171.     = 0xA9BD;
  172. pascal void CloseWindow(WindowPtr theWindow)
  173.     = 0xA92D;
  174. pascal void DisposeWindow(WindowPtr theWindow)
  175.     = 0xA914;
  176. void setwtitle(WindowPtr theWindow,char *title);
  177. pascal void GetWTitle(WindowPtr theWindow,Str255 title)
  178.     = 0xA919;
  179. pascal void SelectWindow(WindowPtr theWindow)
  180.     = 0xA91F;
  181. pascal void HideWindow(WindowPtr theWindow)
  182.     = 0xA916;
  183. pascal void ShowWindow(WindowPtr theWindow)
  184.     = 0xA915;
  185. pascal void ShowHide(WindowPtr theWindow,Boolean showFlag)
  186.     = 0xA908;
  187. pascal void HiliteWindow(WindowPtr theWindow,Boolean fHilite)
  188.     = 0xA91C;
  189. pascal void BringToFront(WindowPtr theWindow)
  190.     = 0xA920;
  191. pascal void SendBehind(WindowPtr theWindow,WindowPtr behindWindow)
  192.     = 0xA921;
  193. pascal WindowPtr FrontWindow(void)
  194.     = 0xA924;
  195. pascal void DrawGrowIcon(WindowPtr theWindow)
  196.     = 0xA904;
  197. pascal void MoveWindow(WindowPtr theWindow,short hGlobal,short vGlobal,
  198.     Boolean front)
  199.     = 0xA91B;
  200. pascal void SizeWindow(WindowPtr theWindow,short w,short h,Boolean fUpdate)
  201.     = 0xA91D;
  202. pascal void ZoomWindow(WindowPtr theWindow,short partCode,Boolean front)
  203.     = 0xA83A;
  204. pascal void InvalRect(const Rect *badRect)
  205.     = 0xA928;
  206. pascal void InvalRgn(RgnHandle badRgn)
  207.     = 0xA927;
  208. pascal void ValidRect(const Rect *goodRect)
  209.     = 0xA92A;
  210. pascal void ValidRgn(RgnHandle goodRgn)
  211.     = 0xA929;
  212. pascal void BeginUpdate(WindowPtr theWindow)
  213.     = 0xA922;
  214. pascal void EndUpdate(WindowPtr theWindow)
  215.     = 0xA923;
  216. pascal void SetWRefCon(WindowPtr theWindow,long data)
  217.     = 0xA918;
  218. pascal long GetWRefCon(WindowPtr theWindow)
  219.     = 0xA917;
  220. pascal void SetWindowPic(WindowPtr theWindow,PicHandle pic)
  221.     = 0xA92E;
  222. pascal PicHandle GetWindowPic(WindowPtr theWindow)
  223.     = 0xA92F;
  224. pascal Boolean CheckUpdate(EventRecord *theEvent)
  225.     = 0xA911;
  226. pascal void ClipAbove(WindowPeek window)
  227.     = 0xA90B;
  228. pascal void SaveOld(WindowPeek window)
  229.     = 0xA90E;
  230. pascal void DrawNew(WindowPeek window,Boolean update)
  231.     = 0xA90F;
  232. pascal void PaintOne(WindowPeek window,RgnHandle clobberedRgn)
  233.     = 0xA90C;
  234. pascal void PaintBehind(WindowPeek startWindow,RgnHandle clobberedRgn)
  235.     = 0xA90D;
  236. pascal void CalcVis(WindowPeek window)
  237.     = 0xA909;
  238. pascal void CalcVisBehind(WindowPeek startWindow,RgnHandle clobberedRgn)
  239.     = 0xA90A;
  240. pascal long GrowWindow(WindowPtr theWindow,Point startPt,const Rect *bBox)
  241.     = 0xA92B;
  242. Boolean trackgoaway(WindowPtr theWindow,Point *thePt);
  243. pascal short FindWindow(Point thePoint,WindowPtr *theWindow)
  244.     = 0xA92C;
  245. short findwindow(Point *thePoint,WindowPtr *theWindow); 
  246. pascal long PinRect(const Rect *theRect,Point thePt)
  247.     = 0xA94E;
  248. pascal long DragGrayRgn(RgnHandle theRgn,Point startPt,const Rect *boundsRect,
  249.     const Rect *slopRect,short axis,DragGrayRgnProcPtr actionProc)
  250.     = 0xA905;
  251. pascal Boolean TrackBox(WindowPtr theWindow,Point thePt,short partCode)
  252.     = 0xA83B;
  253. pascal void GetCWMgrPort(CGrafPtr *wMgrCPort)
  254.     = 0xAA48;
  255. void getwtitle(WindowPtr theWindow,char *title);
  256. pascal void SetWinColor(WindowPtr theWindow,WCTabHandle newColorTable)
  257.     = 0xAA41;
  258. pascal Boolean GetAuxWin(WindowPtr theWindow,AuxWinHandle *awHndl)
  259.     = 0xAA42;
  260. long growwindow(WindowPtr theWindow,Point *startPt,const Rect *bBox);
  261. pascal void SetDeskCPat(PixPatHandle deskPixPat)
  262.     = 0xAA47;
  263. WindowPtr newwindow(Ptr wStorage,const Rect *boundsRect,char *title,Boolean visible,
  264.     short theProc,WindowPtr behind,Boolean goAwayFlag,long refCon); 
  265. pascal WindowPtr NewCWindow(Ptr wStorage,const Rect *boundsRect,const Str255 title,
  266.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon)
  267.     = 0xAA45;
  268. WindowPtr newcwindow(Ptr wStorage,const Rect *boundsRect,char *title,Boolean visible,
  269.     short procID,WindowPtr behind,Boolean goAwayFlag,long refCon);
  270. pascal WindowPtr GetNewCWindow(short windowID,Ptr wStorage,WindowPtr behind)
  271.     = 0xAA46;
  272. pascal short GetWVariant(WindowPtr theWindow)
  273.     = 0xA80A;
  274. long pinrect(const Rect *theRect,Point *thePt); 
  275. pascal RgnHandle GetGrayRgn(void);
  276. pascal void SetWTitle(WindowPtr theWindow,const Str255 title)
  277.     = 0xA91A;
  278. Boolean trackbox(WindowPtr theWindow,Point *thePt,short partCode);
  279. pascal Boolean TrackGoAway(WindowPtr theWindow,Point thePt)
  280.     = 0xA91E;
  281. pascal void DragWindow(WindowPtr theWindow,Point startPt,const Rect *boundsRect)
  282.     = 0xA925;
  283. long draggrayrgn(RgnHandle theRgn,Point *startPt,const Rect *boundsRect,
  284.     const Rect *slopRect,short axis,DragGrayRgnProcPtr actionProc); 
  285. void dragwindow(WindowPtr theWindow,Point *startPt,const Rect *boundsRect); 
  286. #ifdef __cplusplus
  287. }
  288. #endif
  289.  
  290. #endif
  291.